import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '../views/HomePage.vue'
import UserLoginPage from "@/views/user/UserLoginPage.vue";
import UserRegisterPage from "@/views/user/UserRegisterPage.vue";
import UserManagePage from "@/views/admin/UserManagePage.vue";
import AddPicturePage from "@/views/AddPicturePage.vue";
import PictureManagePage from "@/views/admin/PictureManagePage.vue";
import PictureDetailPage from "@/views/PictureDetailPage.vue";
import AddPictureBatchPage from "@/views/AddPictureBatchPage.vue";
import SpaceManagePage from "@/views/admin/SpaceManagePage.vue";
import AddSpacePage from "@/views/AddSpacePage.vue";
import MySpacePage from "@/views/MySpacePage.vue";
import SpaceDetailPage from "@/views/SpaceDetailPage.vue";
import SearchPicturePage from "@/views/SearchPicturePage.vue";
import SpaceAnalyzePage from "@/views/SpaceAnalyzePage.vue";
import SpaceUserManagePage from "@/views/admin/SpaceUserManagePage.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: '主页',
      component: HomePage,
    },
    {
      path: '/user/login',
      name: '用户登录',
      component: UserLoginPage,
    },
    {
      path: '/user/register',
      name: '用户注册',
      component: UserRegisterPage,
    },
    {
      path: '/admin/userManage',
      name: '用户管理',
      component: UserManagePage,
    },
    {
      path: '/admin/pictureManage',
      name: '图片管理',
      component: PictureManagePage,
    },
    {
      path: '/add_picture',
      name: '创建图片',
      component: AddPicturePage,
    },
    {
      path: '/add_picture/batch',
      name: '批量创建图片',
      component: AddPictureBatchPage,
    },
    {
      path: '/picture/:id',
      name: '图片详情',
      component: PictureDetailPage,
      props: true,
    },
    {
      path: '/admin/spaceManage',
      name: '空间管理',
      component: SpaceManagePage,
    },
    {
      path: '/add_space',
      name: '创建空间',
      component: AddSpacePage,
    },
    {
      path: '/my_space',
      name: '我的空间',
      component: MySpacePage,
    },
    {
      path: '/space/:id',
      name: '空间详情',
      component: SpaceDetailPage,
      props: true,
    },
    {
      path: '/search_picture',
      name: '图片搜索',
      component: SearchPicturePage,
    },
    {
      path: '/space_analyze',
      name: '空间分析',
      component: SpaceAnalyzePage,
    },
    {
      path: '/spaceUserManage/:id',
      name: '空间成员管理',
      component: SpaceUserManagePage,
      props: true,
    },
  ],
})

export default router
